package com.sh.ndt.user.service;

import com.sh.ndt.common.DateUtil;
import com.sh.ndt.exam.entity.Exam;
import com.sh.ndt.exception.DAOException;
import com.sh.ndt.exception.ServiceException;
import com.sh.ndt.user.dao.UserEntitlementDAO;
import com.sh.ndt.user.entity.UserDashboardDetail;
import com.sh.ndt.user.entity.UserEntitlement;
import com.sh.ndt.user.entity.UsersExamHistory;
import com.sh.ndt.user.entity.UsersTestHistory;
import java.util.Date;
import java.util.logging.Level;
import org.apache.log4j.Logger;

/**
 * Class implementing IUnserEntitlementService interface
 *
 * @author Manjula Hosadurga
 */
public class UserEntitlementServiceImpl implements UserEntitlementService {

    private static Logger LOGGER = Logger.getLogger(UserEntitlementServiceImpl.class);
    
    UserEntitlementDAO userEntitlementDao;
    
    public UserEntitlementServiceImpl(UserEntitlementDAO userEntitlementDao) throws ServiceException {
        try {
            LOGGER.debug("*************** Inside UserEntitlementServiceImpl Constructor ***************");
            this.userEntitlementDao = userEntitlementDao;
            
        } catch (Exception e) {
            throw new ServiceException(e);
        }
    }

    @Override
    public UserDashboardDetail getUserDashboardDetail(int userId) throws ServiceException{
        
        LOGGER.debug("Building User Dashboard Contents..........");
        try {
            return userEntitlementDao.getUserDashboardDetail(userId);
        } catch (DAOException ex) {
            LOGGER.debug(ex);
        }
        return null;
        
    }
    
    @Override
    public UserEntitlement loadUserEntitlement(int userId) throws ServiceException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    
}
